<template>
	<div>
		<div>{{ count }}</div>
		<button ref="a" @click="btn">点击加一{{count}}</button>
	</div>
</template>

<script>
export default {
	data() {
		return {
            count: 0,
        };
	},
	methods: {
		btn() {
			this.count++;
            // 点击改data之后，用$nextTick马上就可以获取原生DOM数据改变之后的内容 
			this.$nextTick(() => {
                console.log(this.count);
				console.log('DOM跟新后触发$nextTick函数');
				console.log(this.$refs.a.innerHTML);
			});
		},
	},
};
</script>

<style scoped>
</style>